package model.conditions;

import metier.GameState;
import metier.Objet;

public class DeathCondition extends Condition {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8038029990434515653L;
	protected Integer deathValue;
	
	public DeathCondition() {
		super();
	}
	
	public DeathCondition(Integer deathValue) {
		super();
		this.deathValue = deathValue;
	}



	public Integer getDeathValue() {
		return deathValue;
	}



	public void setDeathValue(Integer deathValue) {
		this.deathValue = deathValue;
	}



	@Override
	public boolean verify(GameState state, Objet sender) {
		Boolean res = false;
		
		if(state.getDeathValue() >= deathValue) {
			res = true;
		}
		
		if(!inverse) {
			return res;
		} else {
			return !res;
		}
	}

}
